package com.cyss.greenball.main;

import com.cyss.greenball.util.SystemUtil;

import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class GameMenuActivity extends BaseActivity {

	private Button startGame;
	private Button createMap;
	private Button myMap;
	private Button downloadMap;
	private Button quitGame;

	@Override
	protected void init() {
		startGame = (Button) findViewById(R.id.start_game);
		createMap = (Button) findViewById(R.id.map_create);
		myMap = (Button) findViewById(R.id.my_map);
		downloadMap = (Button) findViewById(R.id.download_map);
		quitGame = (Button) findViewById(R.id.quit_game);
		Display display = getWindowManager().getDefaultDisplay();
		SystemUtil.SCREEN_WIDTH = display.getWidth();
		SystemUtil.SCREEN_HEIGHT = display.getHeight();
		SystemUtil.GREEN_BALL_RADIUS = SystemUtil.SCREEN_WIDTH / 22;
	}

	@Override
	protected void setOnListener() {
		startGame.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// Toast.makeText(GameMenuActivity.this, "not yet",
				// Toast.LENGTH_LONG).show();
				Intent intent = new Intent(GameMenuActivity.this,
						WorldActivity.class);
				startActivity(intent);
			}
		});

		createMap.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// Toast.makeText(GameMenuActivity.this, "not yet",
				// Toast.LENGTH_LONG).show();
				Intent intent = new Intent(GameMenuActivity.this,
						CreateMapActivity.class);
				startActivity(intent);
			}
		});

		myMap.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(GameMenuActivity.this,
						MyMapActivity.class);
				startActivity(intent);
			}
		});
		
		downloadMap.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(GameMenuActivity.this,
						DownloadMapActivity.class);
				startActivity(intent);
			}
		});

		quitGame.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				GameMenuActivity.this.finish();
			}
		});
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState, R.layout.game_menu);
	}
}
